//
//  JSMLeavingMainAndHotModel.m
//  TakeYouTourTogether
//
//  Created by dllo on 15/11/30.
//  Copyright © 2015年 king. All rights reserved.
//

#import "JSMLeavingMainAndHotModel.h"

@implementation JSMLeavingMainAndHotModel

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"user"]) {
        self.useModel = [[JSMLeavingUserModel alloc] init];
        [self.useModel setValuesForKeysWithDictionary:value];
    }if ([key isEqualToString:@"text"]) {
        self.textStr = value;
    }
//    if ([key isEqual:@"id"]) {
//        self.urlId = value;
//    }
    if ([key isEqualToString:@"id"]) {
        self.urlId = value;
    }
}

- (id)initWithCoder:(NSCoder *)aDecoder {
    self = [super init];
    if (self) {
        self.textStr = [aDecoder decodeObjectForKey:@"textStr"];
        self.index_cover = [aDecoder decodeObjectForKey:@"index_cover"];
        self.index_title = [aDecoder decodeObjectForKey:@"cover_image_s"];
//        self.cover_image_s = [aDecoder decodeObjectForKey:@""];
        self.cover_image = [aDecoder decodeObjectForKey:@"cover_image"];
        self.useModel = [aDecoder decodeObjectForKey:@"useModel"];
        self.urlId = [aDecoder decodeObjectForKey:@"urlId"];
//        self.urlId = [aDecoder decodeIntegerForKey:@""]
        self.popular_place_str = [aDecoder decodeObjectForKey:@"popular_place_str"];
        self.spot_id = [aDecoder decodeObjectForKey:@"spot_id"];
    }
    return self;
}

- (void)encodeWithCoder:(NSCoder *)aCoder {
    [aCoder encodeObject:self.textStr forKey:@"textStr"];
    [aCoder encodeObject:self.index_cover forKey:@"index_cover"];
    [aCoder encodeObject:self.index_title forKey:@"index_title"];
//    [aCoder encodeObject:self.cover_image_s forKey:@""];
    [aCoder encodeObject:self.cover_image forKey:@"cover_image"];
    [aCoder encodeObject:self.useModel forKey:@"useModel"];
    [aCoder encodeObject:self.urlId forKey:@"urlId"];
    [aCoder encodeObject:self.popular_place_str forKey:@"popular_place_str"];
    [aCoder encodeObject:self.spot_id forKey:@"spot_id"];

}

@end
